package com.itheima.health.dao;

import com.itheima.health.pojo.OrderSetting;
import org.apache.ibatis.annotations.*;

import java.util.ArrayList;
import java.util.Date;

/**
 * 预约设置持久层
 *
 * @author liuqi
 * @Date 2023/11/20
 */
@Mapper
public interface OrdersettingDao {
    /**
     * 动态修改
     */
    @Update("update t_ordersetting set number = #{number} where orderDate = #{orderDateStr}")
    void update(int number, String orderDateStr);

    /**
     *  根据预约时间查询预约设置信息
     * @return          预约设置信息
     */
    OrderSetting seleteByOrderDate(String date);

    /**
     * 插入
     *
     * @param orderSetting
     */
    @Insert("insert into t_ordersetting(orderDate, number, reservations) VALUES " +
            "(#{orderDate}, #{number}, #{reservations})")
    void insert(OrderSetting orderSetting);



    /**
     *  根据id修改已预约人数
     * @param reservations
     * @param id
     */
    void updateReservations(Integer reservations,Integer id);
}
